let express = require('express');
let mysql = require('mysql');
let router = express.Router();
let connection = mysql.createConnection({
    host : 'localhost',
    user:'root',
    password : 'root',
    database : 'express'
});
router.post('/dropData', (req, res) => {
    let sql = `select * from goods_name`;
    connection.query(sql,(err,result) => {
        if (err) {
            console.log('error',err);
        } else {
                let dataString = JSON.stringify(result);
                let data = JSON.parse(dataString);
                res.json({
                    status : 200,
                    data ,
                })
        }
    });
});
module.exports = router;
